package com.yuebao.model.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 基金产品表
 * @TableName fund_production
 */
@TableName(value ="fund_production")
@Data
public class FundProduction implements Serializable {
    /**
     *
     */
    @TableId(value = "fund_id")
    private Long fundId;

    /**
     * 产品名称
     */
    @TableField(value = "product_name")
    private String productName;

    /**
     * 基金账户
     */
    @TableField(value = "fund_account")
    private BigDecimal fundAccount;

    /**
     * 基金经理
     */
    @TableField(value = "fund_manager")
    private String fundManager;

    /**
     * 基金公司
     */
    @TableField(value = "fund_company")
    private String fundCompany;

    /**
     * 基金公司id
     */
    @TableField(value = "company_id")
    private Integer companyId;

    /**
     * 七日年化收益率
     */
    @TableField(value = "profit_rate")
    private BigDecimal profitRate;

    /**
     * 每份多少钱
     */
    @TableField(value = "share_price")
    private BigDecimal sharePrice;

    /**
     * 状态(在售/下架)
     */
    @TableField(value = "state")
    private Integer state;

    /**
     * 上架时间
     */
    @TableField(value = "release_time")
    private Date releaseTime;

    /**
     *
     */
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    /**
     * 描述
     */
    @TableField(value = "description")
    private String description;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        FundProduction other = (FundProduction) that;
        return (this.getFundId() == null ? other.getFundId() == null : this.getFundId().equals(other.getFundId()))
            && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
            && (this.getFundAccount() == null ? other.getFundAccount() == null : this.getFundAccount().equals(other.getFundAccount()))
            && (this.getFundManager() == null ? other.getFundManager() == null : this.getFundManager().equals(other.getFundManager()))
            && (this.getFundCompany() == null ? other.getFundCompany() == null : this.getFundCompany().equals(other.getFundCompany()))
            && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
            && (this.getProfitRate() == null ? other.getProfitRate() == null : this.getProfitRate().equals(other.getProfitRate()))
            && (this.getSharePrice() == null ? other.getSharePrice() == null : this.getSharePrice().equals(other.getSharePrice()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getReleaseTime() == null ? other.getReleaseTime() == null : this.getReleaseTime().equals(other.getReleaseTime()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getFundId() == null) ? 0 : getFundId().hashCode());
        result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
        result = prime * result + ((getFundAccount() == null) ? 0 : getFundAccount().hashCode());
        result = prime * result + ((getFundManager() == null) ? 0 : getFundManager().hashCode());
        result = prime * result + ((getFundCompany() == null) ? 0 : getFundCompany().hashCode());
        result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
        result = prime * result + ((getProfitRate() == null) ? 0 : getProfitRate().hashCode());
        result = prime * result + ((getSharePrice() == null) ? 0 : getSharePrice().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getReleaseTime() == null) ? 0 : getReleaseTime().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", productId=").append(fundId);
        sb.append(", productName=").append(productName);
        sb.append(", fundAccount=").append(fundAccount);
        sb.append(", fundManager=").append(fundManager);
        sb.append(", fundCompany=").append(fundCompany);
        sb.append(", companyId=").append(companyId);
        sb.append(", profitRate=").append(profitRate);
        sb.append(", sharePrice=").append(sharePrice);
        sb.append(", state=").append(state);
        sb.append(", releaseTime=").append(releaseTime);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", description=").append(description);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
